package com.zy.experience_system.repository;

import com.zy.experience_system.entity.StuAndClass;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

public interface StuAndClassRepository extends JpaRepository<StuAndClass,Integer> {
    List<StuAndClass> findAllByClassId(Integer classId);
    StuAndClass findByClassIdAndStuId(Integer classId,String stuId);
    @Transactional
    void deleteByClassIdAndStuId(Integer classId,String stuId);
    Integer countAllByClassId(Integer classId);
}
